package operators;

import org.apache.flink.streaming.api.functions.windowing.WindowFunction;
import org.apache.flink.streaming.api.windowing.windows.TimeWindow;
import org.apache.flink.util.Collector;
import pojo.PageViewCount;

public class PV_Modify_01_WindowedFunction implements WindowFunction<Integer, PageViewCount, Integer, TimeWindow> {
    @Override
    public void apply(Integer integer, TimeWindow window, Iterable<Integer> input, Collector<PageViewCount> out) throws Exception {
        out.collect(new PageViewCount(
                integer.toString()
                , window.getEnd()
                , input.iterator().next()
        ));
    }
}
